package com.sz.app.oss.api.logistics.base;

import com.sz.common.base.dto.ResultDto;
import com.sz.common.base.exception.BizException;
import com.sz.common.core.system.entity.SysDict;
import com.sz.common.core.system.service.SysDictService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * Function: 货物类型 controller <br>
 * Author: wentao.chang <br>
 * Date: 2017-03-17 10:08:00
 */

@RestController
@RequestMapping("${api}/biz/cargotypes")
@Api(description = " ", tags = "034、货物类型")
public class CargoTypesController {
    @Autowired
    private SysDictService dictService;

    @ApiOperation(value = "获取货物类型列表", notes = "返回货物类型列表")
    @RequestMapping(value = "", method = {RequestMethod.GET})
    public
    @ResponseBody
    ResultDto getCargoTypes() throws BizException {
        List<SysDict> dictList = dictService.findByCatalog("biz.cargo.type");
        ResultDto dto = new ResultDto();
        dto.setData(dictList);
        return dto;
    }
}
